package com.wdb007.venus.svc.biz.utils;

import java.awt.Font;
import java.io.File;
import java.io.FileInputStream;

public class FontUtil {

	public static Font loadFont(String fontFilePath, float fontSize) {
		try {
			File file = new File(fontFilePath);
			FileInputStream aixing = new FileInputStream(file);
			Font dynamicFont = Font.createFont(Font.TRUETYPE_FONT, aixing);
			Font dynamicFontPt = dynamicFont.deriveFont(fontSize);
			aixing.close();
			return dynamicFontPt;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

}
